<?php
namespace App\Services;
use App\Models\Swiper;
use App\Models\Category;
use App\Models\Anounce;
use App\Models\Goods;
use App\Http\Resources\Swiper as SwiperResource;
use App\Http\Resources\Category as CategoryResource;

class IndexService 
{
	public function getIndexData()
	{
		$data['swipers'] = SwiperResource::collection(Swiper::orderBy('sort')->get());
	    $data['categories'] = CategoryResource::collection(Category::top()->limit(10)->get());
	    $data['anounce'] = Anounce::latest()->limit(3)->get();
	    $data['member_goods'] = Goods::memberGoods()->get();
	    return $data;
	}
}